package com.trkj.dao.jpa;


import java.util.List;

import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import com.trkj.pojos.Tbshift;
/**
 * 班次DAO
 * @author lenovo
 *
 */
public interface IHwcShiftDAO extends CrudRepository<Tbshift, Long> {
	/**
	 * 分页查询没有被废弃的班次
	 * @return
	 */
	@Query("select s from Tbshift s where s.shiftState != '废弃' order by s.shiftNo desc")
	public List<Tbshift> queryShift(Pageable pagerble);
	/**
	 * 获取没有被废弃的班次的数量
	 * @return
	 */
	@Query("select count(*) from Tbshift s where s.shiftState != '废弃'")
	public Long queryShiftCount();
	
	/**
	 * 查询所有没有被废弃的班次(不分页)
	 * @return
	 */
	@Query("select s from Tbshift s where s.shiftState != '废弃' order by s.shiftNo desc")
	public List<Tbshift> queryAllShift();
	

}
